﻿<%@ Page Language="C#" MasterPageFile="~/user.master" AutoEventWireup="true" Inherits="MediaMonitor.Users.Report_Outdoor"
     Title="Report - Outdoor" CodeBehind="report-outdoor.aspx.cs" %>
     
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server">
    <link href="../rad-scripts/Grid.MyCustomSkin.css" rel="stylesheet" type="text/css" /> 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" Runat="Server">
    
    <asp:UpdatePanel ID="pnlUpdate" runat="server">
        <ContentTemplate>

<div id="InnerDIVTOP" runat="server" visible="false">
    <div style="text-align: right; padding-right: 10px; padding-bottom:10px;">
   

           <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
            <td align="right">
             <asp:Panel runat="server" ID="PnlAdv"  Visible="false" >
            <span style="padding-left:10px;">Advertiser :</span>
            <asp:Button ID="btnDownloadAllAdv" runat="server" Text="Download All" 
                 OnClick="btnDownloadAllAdv_Clicked" class="button sm_button"/>
                </asp:Panel>
            </td>
            <td  align="right">
              <asp:Panel runat="server" ID="PnlProduct"  Visible="false">
             <span style="padding-left:10px;">Product:</span>
            <asp:Button ID="btnDownloadAllProduct" runat="server" Text="Download All" 
                OnClick="btnDownloadAllProduct_Clicked" class="button sm_button"/>
                 </asp:Panel>
            </td>

            <td align="right">
             <asp:Panel runat="server" ID="pnlCategory"  Visible="false" >
            <span style="padding-left:10px;">Category :</span>
           <asp:Button ID="btnDownloadAll" runat="server" Text="Download All" 
                OnClick="btnDownloadAll_Clicked" class="button sm_button"/>
                </asp:Panel>
                </td>

               
           <td align="right" style="width:15%;">
            <asp:Button ID="btnExport" runat="server" class="button sm_button" Text="Export" OnClick="btnExport_Clicked" />
            </td>
            </tr>
            </table>
    </div>
     <div style="text-align: center; padding: 10px; padding-bottom: 20px; border: none;">
            <asp:LinkButton ID="lnlBack" runat="server" Text="..Go back to summary.." OnClick="lnlBack_Clicked"
                Font-Size="16"></asp:LinkButton>
        </div>
    </div>
    
     <div id="SummaryDIVTOP" runat="server" visible="false">
        <div style="text-align: right; padding-right: 10px; padding-bottom: 5px;">
              <table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td width="10%" align="left">
            <asp:Label ID="lblSummary" runat="server" Text="SUMMARY" ForeColor="#0066FF"   Font-Size="14"></asp:Label>
              </td>
       <td align="right" width="60%" >
              <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
            <td align="right">
             <asp:Panel runat="server" ID="pnlSummaryAdv"  Visible="false" >
            <span style="padding-left:10px;">Advertiser :</span>
            <asp:Button ID="btnDownloadAllSummaryAdvertiser" runat="server" Text="Download All" 
                 OnClick="btnDownloadAllSummaryAdvertiser_Clicked" class="button sm_button"/>
                </asp:Panel>
            </td>
            <td  align="right">
              <asp:Panel runat="server" ID="pnlSummaryProduct"  Visible="false">
             <span style="padding-left:10px;">Product:</span>
            <asp:Button ID="btnDownloadAllSummaryProduct" runat="server" Text="Download All" 
                OnClick="btnDownloadAllSummaryProduct_Clicked" class="button sm_button"/>
                 </asp:Panel>
            </td>
            <td  align="right">
               <asp:Panel runat="server" ID="pnlSummaryCategory" Visible="false">
          <span style="padding-left:10px;">Category:</span>
            <asp:Button ID="btnDownloadAllSummary" runat="server" Text="Download All" 
                OnClick="btnDownloadAllSummary_Clicked" class="button sm_button"/>
               </asp:Panel>
            </td>
            <td  align="right" style="width:25%;">
             <asp:Button ID="btnExportSummary" runat="server" class="button sm_button" Text="Export with Summary" OnClick="btnExportSummary_Clicked"/> 
            </td>
            </tr>
            </table>
             </td>
            </tr></table>
        </div>
       
    </div>
     
      <telerik:RadGrid ID="radGridAll" runat="server" AutoGenerateColumns="false" AllowSorting="True"
                GridLines="Both" PageSize="20" ItemStyle-Font-Size="7" EnableEmbeddedSkins="false"
                Skin="MyCustomSkin" EnableEmbeddedBaseStylesheet="False" OnNeedDataSource="radGridAll_NeedDataSource"
                OnItemCommand="radGridAll_ItemCommand" MasterTableView-AllowPaging="false">
                <MasterTableView Name="ReportAll" ItemStyle-BorderWidth="1" DataKeyNames="MediaType,CountRecord">
                    <AlternatingItemStyle Font-Size="Small" />
                    <ItemStyle Font-Size="Small" />
                   
                    <Columns>
                        <telerik:GridTemplateColumn ItemStyle-Width="20px" UniqueName="MediaType">
                            <ItemTemplate>
                                
                                <asp:Label ID="lblMTN" Text='<%#Eval("MediaType")%>' runat="server" Visible="false"></asp:Label>
                                <img src='../images/media/<%#Eval("MediaTypeName")%>.png' alt='<%#Eval("MediaTypeName")%>' />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn ItemStyle-Width="400" UniqueName="CountRecord" HeaderText="Media Total Records">
                            <ItemTemplate>
                                found <b>
                                    <%#Eval("CountRecord")%></b> records related to your search
                            </ItemTemplate>
                            <ItemStyle Font-Size="8" />
                        </telerik:GridTemplateColumn>

                        <telerik:GridBoundColumn DataField="InvestmentGrid" HeaderText="Total Investment" DataFormatString="{0:C0}"
                                ItemStyle-HorizontalAlign="Right" UniqueName="Investment"   />

                        <telerik:GridTemplateColumn ItemStyle-Width="235" UniqueName="Video" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkGetDetail" runat="server" CommandName="GetDetail" Text="Click for Details">
                                </asp:LinkButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

               <asp:ObjectDataSource ID="objDSAll" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportOutdoor_Count" SelectCountMethod="GetReportOutdoor_RowCountTotal"
                EnablePaging="true" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_Selecting">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" /> 
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="mediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="mediaCodes" Type="String"  DefaultValue="" ConvertEmptyStringToNull="true" />
                    <asp:Parameter Name="sectorCode" Type="Int32"   DefaultValue="0" />
                    <asp:Parameter Name="subSectorCode" Type="Int32"  
                        DefaultValue="0" />
                    
                    <asp:Parameter Name="categoryCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="advertiserCode" Type="Int32"  
                        DefaultValue="0" />
                    <asp:Parameter Name="brandCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="productCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="prodVersionCode" Type="Int32" 
                        DefaultValue="0" />
                    <asp:Parameter Name="agencyCode" Type="Int32"   DefaultValue="0" />
                    <asp:Parameter Name="sPrice" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="ePrice" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="size" Type="Int32"   DefaultValue="0" />
                    <asp:Parameter Name="quality" Type="String"  DefaultValue="0" ConvertEmptyStringToNull="true" />
                    <asp:Parameter Name="typeOfAds" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="fa" Type="Boolean"  DefaultValue="0" />
                </SelectParameters>
            </asp:ObjectDataSource>

    
         <div id="InnerDIV" runat="server" style="display:none;">
        <div style="display:none">
        
        <div style="float:left; text-align:left; padding:10px; border:none;">
                <table>
            <tr>
                <td>
                    <asp:LinkButton ID="lnkGrp_Adv" runat="server" Text="Group Advertiser" CommandArgument="AdvertiserName"
                        OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                </td>
                <td>
                    <asp:LinkButton ID="lnkGrp_Agnc" runat="server" Text="Group Agency" CommandArgument="AgencyName"
                        OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                </td>
                <td>
                    <asp:LinkButton ID="lnkGrp_Brnd" runat="server" Text="Group Brand" CommandArgument="BrandName"
                        OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                </td>
                <td>
                    <asp:LinkButton ID="lnkGrp_Prod" runat="server" Text="Group Product" CommandArgument="ProductName"
                        OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                </td>
                <td>
                    <asp:LinkButton ID="lnkGrp_Media" runat="server" Text="Group Media" CommandArgument="MediaName"
                        OnClick="lnkGrp_Clicked" class="Box"></asp:LinkButton>
                </td>
                
            </tr> 
        </table>

        </div>

        <div style="float: right; text-align: right; padding: 10px; border: none;">
            <asp:LinkButton ID="lnkClearGroup" runat="server" Text="[Clear Grouping]" Visible="false"
                OnClick="lnkClearGroup_Clicked"></asp:LinkButton>
        </div>
        
        </div>
        <br />
        <telerik:RadGrid ID="radGrid" runat="server" AllowPaging="True" AutoGenerateColumns="false"
            AllowSorting="True" GridLines="Both"  
            ShowGroupPanel="True" OnPreRender="radGrid_PreRender" PageSize="20" ItemStyle-Font-Size="8"
            EnableEmbeddedSkins="false" Skin="MyCustomSkin" 
             PagerStyle-FirstPageText="First" PagerStyle-LastPageText="Last" 
             PagerStyle-NextPageText="Next" PagerStyle-PrevPageText="Previous" PagerStyle-VerticalAlign="Middle"  
            onitemcommand="radGrid_ItemCommand" EnableEmbeddedBaseStylesheet="False" 
             onneeddatasource="radGrid_NeedDataSource">
             <ExportSettings ExportOnlyData="true" Excel-Format="ExcelML" IgnorePaging="true" FileName="MediaMonitor-CommercialReport"></ExportSettings>
            <MasterTableView Name="Report" ShowFooter="true" ItemStyle-BorderWidth="1" DataKeyNames="ProdVersionID, ProductID, Price, MediaTypeCode, NewOutDoorFile" >
                <FooterStyle Font-Bold="true" ForeColor="AliceBlue" /> 
                <GroupHeaderItemStyle Font-Bold="true" Font-Size="Larger" />
                <AlternatingItemStyle Font-Size="Smaller" />
                <ItemStyle Font-Size="Smaller" />
                <Columns>
                     <telerik:GridBoundColumn DataField="RFDate" HtmlEncode="false" DataFormatString="{0:d}"
                         HeaderText="Date" UniqueName="RFDate" ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="MediaTypeName" HeaderText="Media" UniqueName="MediaType"
                        ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="MediaName" HeaderText="Media" UniqueName="Media"
                        ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="AgencyName" HeaderText="Agency" UniqueName="Agency"
                        ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="AdvertiserName" HeaderText="Advertiser" UniqueName="Advertiser" ItemStyle-Font-Size="7"   />
                    <telerik:GridBoundColumn DataField="BrandName" HeaderText="Product" UniqueName="Product"
                        ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="ProductName" HeaderText="Product" UniqueName="Brand"
                        ItemStyle-Font-Size="7" />

                    <telerik:GridBoundColumn DataField="ProdVersionName" HeaderText="Version" UniqueName="ProdVersion"
                        ItemStyle-Font-Size="7" />
                    
                    <telerik:GridBoundColumn DataField="SectorName" HeaderText="Sector" UniqueName="Sector"
                        ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="SubSectorName" HeaderText="Sub Sector" UniqueName="SubSector"
                        ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="CategoryName" HeaderText="Category" UniqueName="Category"
                        ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="TimeStartFormatted" HeaderText="Start Time" ItemStyle-HorizontalAlign="Right"
                        UniqueName="STime" ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="TimeEndFormatted" HeaderText="End Time" ItemStyle-HorizontalAlign="Right"
                        UniqueName="ETime" ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="Size" HeaderText="Size" ItemStyle-HorizontalAlign="Right"
                        UniqueName="Size" ItemStyle-Font-Size="7" DataFormatString="{0} inches" />
                    <telerik:GridBoundColumn DataField="Quality" HeaderText="Quality" ItemStyle-HorizontalAlign="Right"
                        UniqueName="Quality" ItemStyle-Font-Size="7"  />
                    <telerik:GridBoundColumn DataField="TypeOfAds" HeaderText="Type Of Ads" ItemStyle-HorizontalAlign="Right"
                        UniqueName="TypeOfAds" ItemStyle-Font-Size="7"  />
                    <telerik:GridBoundColumn DataField="VisibilityName" HeaderText="Visibility" ItemStyle-HorizontalAlign="Right"
                        UniqueName="VisibilityCode" ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="CarrierName" HeaderText="Carrier" ItemStyle-HorizontalAlign="Right"
                        UniqueName="CarrierCode" ItemStyle-Font-Size="7" />
                    <telerik:GridBoundColumn DataField="BetweenAvenue" HeaderText="BetweenAvenue" ItemStyle-HorizontalAlign="Right"
                        UniqueName="BetweenAvenue" ItemStyle-Font-Size="7" />
                     
                    <telerik:GridBoundColumn DataField="RealCost" HeaderText="Investment" DataFormatString="{0:C0}"
                        ItemStyle-HorizontalAlign="Right" UniqueName="RealCost" ItemStyle-Font-Size="7" /> 
                    <telerik:GridTemplateColumn HeaderText="Image"  ItemStyle-Width="35" UniqueName="Image">
                        <ItemTemplate>
                            <!--for OUTDOOR-->
                            
                            <a href="javascript:void(0);" onclick="PopupCenterWithScroll('../sitefiles/outdoor.aspx?pvid=<%#Eval("ProdVersionID")%>&t=s&file=<%#Eval("NewOutDoorFile")%>', '_blank',750, 700); ">
                                <span style='color: <%# Utility.ToStr(Eval("NewOutDoorFile"))!="" ? "green" : "red"%>;'>
                                    <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 7 &&  Utility.CheckOutDoorAvailability(Utility.ToStr(Eval("NewOutDoorFile")).ToString()), "Preview", "")%>
                                </span></a>
                                <br />
                            <!--for OUTDOOR Street Graph-->
                            <a href="javascript:void(0);" onclick="PopupCenterWithScroll('../sitefiles/outdoor-street.aspx?file=<%#Eval("StreetGraph")%>', '_blank',810, 500); ">
                                <span style='color:green'>
                                    <%#Utility.GetFormattedBool(Utility.ToInt(Eval("MediaTypeCode")) == 7, "Street Graph", "")%>
                                </span></a>
                        </ItemTemplate>

                     </telerik:GridTemplateColumn>


                     <telerik:GridTemplateColumn HeaderText="Price" ItemStyle-HorizontalAlign="Center" UniqueName="Cart">
                        <ItemTemplate>
                            <br />
                            <%# Utility.GetCurrency(DataBinder.Eval(Container.DataItem, "Price", "<b>{0:C2}</b>"))%><br />
                            <asp:LinkButton ID="lnkAdd2Cart" runat="server" CommandName="Add2Cart" OnClientClick="return confirm('Are you sure to add this Outdoor item  to Shopping Cart?')" >
                                <img src="../app_themes/default/buttons/cart-icon.png" alt="" />    
                            </asp:LinkButton>   

                            <!-- add this attribute to above lnkAdd2Cart if u dont wanna show cart icon for unavailable videos
                                  Visible='%#Utility.CheckVideoAvailability(Eval("FullVideoFile").ToString())%>'> 

                            -->
                        </ItemTemplate>
                     </telerik:GridTemplateColumn> 
                     
                      
                </Columns>
            </MasterTableView>
            <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                <Resizing AllowColumnResize="true" />
            </ClientSettings> 
        </telerik:RadGrid>
          </div>
          
            <asp:ObjectDataSource ID="objDS" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportOutdoor_Paged" SelectCountMethod="GetReportOutdoor_RowCount"
                EnablePaging="true" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_Selecting">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" /> 
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="mediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="mediaCodes" Type="String"  DefaultValue="" ConvertEmptyStringToNull="true" />
                    <asp:Parameter Name="sectorCode" Type="Int32"   DefaultValue="0" />
                    <asp:Parameter Name="subSectorCode" Type="Int32"  
                        DefaultValue="0" />
                    
                    <asp:Parameter Name="categoryCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="advertiserCode" Type="Int32"  
                        DefaultValue="0" />
                    <asp:Parameter Name="brandCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="productCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="prodVersionCode" Type="Int32" 
                        DefaultValue="0" />
                    <asp:Parameter Name="agencyCode" Type="Int32"   DefaultValue="0" />
                    <asp:Parameter Name="sPrice" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="ePrice" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="size" Type="Int32"   DefaultValue="0" />
                    <asp:Parameter Name="quality" Type="String"  DefaultValue="0" ConvertEmptyStringToNull="true" />
                    <asp:Parameter Name="typeOfAds" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="fa" Type="Boolean"  DefaultValue="0" />
                </SelectParameters>
            </asp:ObjectDataSource>


             <asp:ObjectDataSource ID="objDSExport" runat="server" TypeName="MediaMonitor.Common.ReportFuncs"
                SelectMethod="GetReportOutdoor_Export" SelectCountMethod="GetReportOutdoor_RowCountExport"
                EnablePaging="true" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows"
                SortParameterName="sortColumn" OnSelecting="ObjDS_SelectingExport">
                <SelectParameters>
                    <asp:Parameter Name="userID" Type="Int32" ConvertEmptyStringToNull="true" DefaultValue="0" /> 
                    <asp:Parameter Name="sDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="eDate" Type="DateTime" ConvertEmptyStringToNull="true" DefaultValue="01/01/2000" />
                    <asp:Parameter Name="mediaTypeCode" Type="Int32" ConvertEmptyStringToNull="true"
                        DefaultValue="0" />
                    <asp:Parameter Name="mediaCodes" Type="String"  DefaultValue="" ConvertEmptyStringToNull="true" />
                    <asp:Parameter Name="sectorCode" Type="Int32"   DefaultValue="0" />
                    <asp:Parameter Name="subSectorCode" Type="Int32"  
                        DefaultValue="0" />
                    
                    <asp:Parameter Name="categoryCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="advertiserCode" Type="Int32"  
                        DefaultValue="0" />
                    <asp:Parameter Name="brandCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="productCode" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="prodVersionCode" Type="Int32" 
                        DefaultValue="0" />
                    <asp:Parameter Name="agencyCode" Type="Int32"   DefaultValue="0" />
                    <asp:Parameter Name="sPrice" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="ePrice" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="size" Type="Int32"   DefaultValue="0" />
                    <asp:Parameter Name="quality" Type="String"  DefaultValue="0" ConvertEmptyStringToNull="true" />
                    <asp:Parameter Name="typeOfAds" Type="Int32"  DefaultValue="0" />
                    <asp:Parameter Name="fa" Type="Boolean"  DefaultValue="0" />
                </SelectParameters>
            </asp:ObjectDataSource>

         <!--do not remove the following btn, used to open the popup-->
         <asp:LinkButton ID="btnShowPop" runat="server" Width="1" Height="1" />

          
         <!--start modal-->
            <script type="text/javascript">


        function SetPostion2(obj, width, height) {

            if (!obj)
                return;

            var left = parseInt((screen.availWidth / 2) - (width / 2));
            var top = parseInt((screen.availHeight / 2) - (height));

            var scrollTop = document.body.scrollTop;
            if (scrollTop == 0) {
                if (window.pageYOffset)
                    scrollTop = window.pageYOffset;
                else
                    scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
            }

            obj.style.left = left + 'px';
            obj.style.top = scrollTop + top + 'px';
            //obj.style.width=width+'px';
            //obj.style.height=height+'px';
            obj.style.position = 'absolute';

        }

        function SetPositionBg2(obj) {
            if (!obj)
                return;

            var left = 0;
            var top = 0;

            var scrollTop = document.body.scrollTop;
            if (scrollTop == 0) {
                if (window.pageYOffset)
                    scrollTop = window.pageYOffset;
                else
                    scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
            }

            obj.style.left = left + 'px';
            obj.style.top = scrollTop + top + 'px';
            //obj.style.width=width+'px';
            obj.style.height = scrollTop + screen.availHeight + 'px';
            obj.style.position = 'absolute';

        }

        function AjaxLoading2(tbl, dv, bool) {
            if (bool) {
                SetPostion2(document.getElementById(tbl), 350, 200);
                SetPositionBg2(document.getElementById(dv));
                document.getElementById(tbl).style.display = 'block';
                //document.getElementById('dvBg').style.display='block';
            }
            else {
                document.getElementById(tbl).style.display = 'none';
                //document.getElementById('dvBg').style.display='none';
            }
        }

  </script>

             <!--warning-->
             <asp:Panel ID="pnl" runat="server" Visible="false">
                <asp:HiddenField ID="hdnPV" runat="server" Value="0" />
                <asp:HiddenField ID="hdnPD" runat="server" Value="0" />
                <asp:HiddenField ID="hdnPrice" runat="server" Value="0" />
                <asp:HiddenField ID="hdnOutDoorFile" runat="server" Value="" />
                 
                 <div id="dvBg2" style="display: block; width: 100%; height: 250%; text-align: center;
                     position: absolute; left: 0px; top: 0px;" class="GreyedOutCss">
                 </div>
                <center>
                    <div id="dvWarning" style="border: solid 4px #ababab; padding: 20px; width: 350px; height: 200px;
                        background-color: White; z-index: 100; position:absolute; top:400px; left:500px; ">
                        <br /><br />
                         
                            <asp:Literal ID="ltrWarningOrderNum" runat="server" />
                         
                        <br />
                        <br />
                        <asp:Button ID="btnCancel" runat="server" Text="Don't Purchase" OnClick="btnCancelPurchase_Clicked" />
                        <asp:Button ID="btnContinue" runat="server" Text="Continue with Purchase" OnClick="btnContinuePurchase_Clicked" />
                    </div>
                </center> 
             </asp:Panel>

             <!--end warning-->
             
             
         </div> 
         <!--end modal-->

        </ContentTemplate>
         <Triggers>
      
         <asp:PostBackTrigger ControlID="btnExport" />
         <asp:PostBackTrigger ControlID="btnDownloadAll" />

            <asp:PostBackTrigger ControlID="btnDownloadAllAdv" />
           <asp:PostBackTrigger ControlID="btnDownloadAllProduct" />

         <asp:PostBackTrigger ControlID="btnExportSummary" />
         <asp:PostBackTrigger ControlID="btnDownloadAllSummary" />

           <asp:PostBackTrigger ControlID="btnDownloadAllSummaryProduct" />
            <asp:PostBackTrigger ControlID="btnDownloadAllSummaryAdvertiser" />
         </Triggers>
    </asp:UpdatePanel>

   
   
</asp:Content>

